
package generator.statements;

/**
 * Payment SQL record mapper.
 * 
 * @author Necro
 * @author Marek Snopkowski <snpy@snpy.info>
 * @version 11.04.2008
 */
public class PaymentForm extends Statement
{
    private static String[] types = { "Gotówka", "Przelew" };
    
    private int paymentFormID;
    private String name;

    private PaymentForm(int id, String name) 
    {
        this.paymentFormID   = id;
        this.name            = name;
    }
    
    public static PaymentForm get(int idx)
    {
        return new PaymentForm(idx + 1, types[idx]);
    }
    
    public static int getTypeCount()
    {
        return types.length;
    }
    
    @Override
    public int getId()
    {
        return paymentFormID;
    }
    
    public String getName()
    {
        return name;
    }
    
    public Object[] getFieldsValueCollection()
    {
        return new Object[]{ paymentFormID, name };
    }
    
    public String getFieldsNameSet()
    {
        return "[payment_form_id], [name]";
    }

    @Override
    public String getTableName()
    {
        return "payment_form";
    }
}
